//homeview的`type

//book list

export interface Content<T> {
  total?: number;
  list?: T[];
}

export interface EBook {
  id?: number;
  name: string;
  category1Id?: number;
  category2Id?: number;
  description: string;
  cover?: string;
  docCount: number;
  viewCount: number;
  voteCount: number;
}
//分类 list
export interface ECategory {
  id?: number;
  parent: number;
  name: string;
  sort: number;
}

//分页
export interface Pagination {
  current: number;
  pageSize: number;
  total: number;
  loginName?: string;
}

//booklist 请求参数
export interface BookListParam {
  page?: number;
  size?: number;
  name?: string;
  id?: number;
  category2Id?: number;
}

//树形分类
export interface Level1 {
  id: number;
  name: string;
  parent: number;
  sort: number;

  children?: Level1[];
}
export interface CategoryTree {
  id: number;
  name: string;
  parent: number;
  sort: number;

  children?: Level1[];
}
export interface CategoryIds {
  category1Id: number;
  category2Id: number;
}

//adminEbook的type

//文档
export interface EDoc {
  id?: number;
  ebookId?: number;
  parent: number;
  name: string;
  sort: number;
  viewCount: number;
  voteCount: number;
  content?: string;
}
export interface EDocTree {
  id?: number;
  parent: number;
  name: string;
  sort: number;
  chidren: EDocTree[];
}

export interface TreeSelectDate {
  disabled?: boolean;
  id?: number;
  name: string;
  parent?: number;
  sort?: number;

  children?: TreeSelectDate[];
}

// -------------user-----------------
export interface User {
  id?: number;
  name?: string;
  loginName: string;
  password?: string;
  token?: string
}
export interface ContentUser {
  id?: number;
  name?: string;
  loginName: string;

  token?: string
}

export interface GoGitee {
  client_id: string,
  redirect_uri: string,
  response_type: string
}


export interface GiteeInfo {
  token: string;
  gistsUrl?: any;
  reposUrl?: any;
  followingUrl?: any;
  bio: string;
  createdAt?: any;
  remark: string;
  login: string;
  type: string;
  blog?: any;
  subscriptionsUrl?: any;
  weibo?: any;
  updatedAt?: any;
  id: number;
  publicRepos: number;
  email?: any;
  organizationsUrl?: any;
  starredUrl?: any;
  followersUrl?: any;
  publicGists: number;
  url: string;
  receivedEventsUrl?: any;
  watched: number;
  followers: number;
  avatarUrl?: any;
  eventsUrl?: any;
  htmlUrl?: any;
  following: number;
  name: string;
  stared: number;


}



export interface EchartsData {
  date: string;
  viewCount: number;
  voteCount: number;
  viewIncrease: number;
  voteIncrease: number;
}



export interface DayStatistic {

  date: string
  viewCount: number,
  voteCount: number,
  viewIncrease: number,
  voteIncrease: number,
  todayViewIncrease?: number,
  todayViewIncreaseRate?: number,
  todayViewIncreaseRateAbs?: number,
  todayVoteCount?: number,
  todayViewCount?: number
}


// ---------------------store-----------------

export interface EbooksStore {
  ebooks: EBook[];
  getEbooks: (params: BookListParam) => Promise<void>;
}

